import type {
  DefaultItemApiResponse,
  ImagesResponse,
  ImageResponse,
} from "@/app/interfaces"
import type { Nullable } from "vitest"

export enum AnimalStatus {
  InShelter = "InShelter",
  Requested = "Requested",
  Owned = "Owned",
}
export interface Animal {
  name: string
  birthDate: string
  status: AnimalStatus
  description: string
  createdAt: string
  updatedAt: string
  publishedAt: string
  gender: "male" | "female"
  photos: ImagesResponse
}
export interface Character {
  name: string
  createdAt: string
  updatedAt: string
}
export interface AnimalWithCharacter extends Animal {
  characterIds: {
    data: DefaultItemApiResponse<Character>[]
  }
  breed: {
    data: DefaultItemApiResponse<Breed>
  }
}
interface Shelter {
  logo: ImageResponse
  address: string
  name: string
}
interface Curator {
  name: string
  phone: string
  avatar: ImageResponse
}
export interface AnimalWitCharacterNCuratorNShelter
  extends AnimalWithCharacter {
  shelter: Nullable<{
    data: DefaultItemApiResponse<Shelter>
  }>
  curator: Nullable<{
    data: DefaultItemApiResponse<Curator>
  }>
}
export interface AnimalResponse
  extends DefaultItemApiResponse<AnimalWithCharacter> {}
export interface AnimalsResponse {
  data: AnimalResponse[]
}

export interface Breed {
  name: string
  code: null
  createdAt: string
  updatedAt: string
  publishedAt: string
}
export interface BreedResponse extends DefaultItemApiResponse<Breed> {}
export interface BreedsResponse {
  data: BreedResponse[]
}
export interface Character {
  name: string
  createdAt: string
  updatedAt: string
}
export interface CharacterResponse extends DefaultItemApiResponse<Character> {}
export interface CharactersResponse {
  data: CharacterResponse[]
}

export interface Request {
  id: string
  state: string
  createdAt: string
  updatedAt: string
}

export interface RequestNAnimalNCurator extends Request {
  animal: Animal & { curator: Curator & { id: string } }
}
